package pe.intix.drawback.model;

import java.util.Date;

import javax.persistence.*;
import org.openxava.annotations.*;
import org.openxava.calculators.*;

/**
 * @author Jeromy Altuna	
 * @author Renato
 */
@Entity
@View(members = "comprobanteVenta")
@Tab(properties = """
		comprobanteVenta.serie, comprobanteVenta.numero, comprobanteVenta.fecha, 
		fechaOperacion"""
)
@Table(name = "detalle_dua_factura_exportacion")
class DetalleDuaFacturaExportacion {

	@Hidden
	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_detalle_dua_factura")
	Long id
	
	@Hidden
	@Column(name = "fecha_operacion")
	@Temporal(TemporalType.TIMESTAMP)
	Date fechaOperacion = new Date()

	@ReferenceView("Simple")
	@JoinColumn(name = "id_dua", referencedColumnName = "id_dua")
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	Dua dua

	@ReferenceView("Simple") @NoFrame @NoCreate
	@JoinColumn(name= "id_comprobante_pago", referencedColumnName = "id_comprobante")
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	ComprobanteVenta comprobanteVenta
}
